package a_obsolete;
import java.sql.SQLException;

import junit.framework.TestCase;


public class LoginGUITest extends TestCase {

	  /**
	   * @wbp.parser.entryPoint
	   */
	  public void testlogin() throws SQLException, ClassNotFoundException {
		  
		  
		  // LoginPanel has been updated, so JUnit test needs to be updated to run
		  // I commented everything out so we wouldn't get errors -- Bethany
		  
		  /* 
		  	getmySQLConnection.getConnection();
		  	LoginPanel panel = new LoginPanel();
		  	String realUsername = "zlee6"; //A real username
		  	String realPassword = "123456789"; //A real password
		  	String otherRealUsername = "bsumner"; //Another real username
		  	String otherRealPassword = "password"; //Another real password
		  	String fakeUsername = "notARealUserName"; //A fake username
		  	String fakePassword = "notARealPassword"; //A fake password
		  	String realPasswordWithFluff = "123456789FLUFF"; //A real password with fluff to overflow it
		  	
		  	//Test a real username
		  	boolean shouldBeTrue = panel.login(realUsername, realPassword);
	        assertEquals(true, shouldBeTrue);
	        
	        //Test another real username
		  	boolean shouldBeTrue_2 = panel.login(otherRealUsername, otherRealPassword);
	        assertEquals(true, shouldBeTrue_2);
	        
	        //Test an actual username with another user's password
	        boolean shouldBeFalse = panel.login(otherRealUsername, realPassword);
	        assertEquals(false,shouldBeFalse);
	        
	        //Flip flop the test from above
	        boolean shouldBeFalse_2 = panel.login(realUsername, otherRealPassword);
	        assertEquals(false,shouldBeFalse_2);
	        
	        //Test case where both usernames are fake
	        boolean shouldBeFalse_3 = panel.login(fakeUsername, fakePassword);
	        assertEquals(false,shouldBeFalse_3);
	        
	        //Test case where the username is real but the password does not exist
	        boolean shouldBeFalse_4 = panel.login(realUsername, fakePassword);
	        assertEquals(false,shouldBeFalse_4);
	        
	        //Test a fake username with a real password
	        boolean shouldBeFalse_5 = panel.login(fakeUsername, realPassword);
	        assertEquals(false,shouldBeFalse_5);
	        
	        //Test a real username where the password is real up to the buffer point
	        //and then fluff is added to make the password longer than the buffer
	        boolean shouldBeFalse_6 = panel.login(realUsername, realPasswordWithFluff);
	        assertEquals(false,shouldBeFalse_6);
	        
	        //Test potential SQL Injection
	        boolean shouldBeFalse_7 = panel.login(realUsername + "; OR bsumner", otherRealPassword);
	        assertEquals(false,shouldBeFalse_7);
	        
	        
	        */
	  }
}
